var express = require('express');
var router = express.Router();
var sqlite3 = require('sqlite3').verbose();
var path = require('path');
/* GET users listing. */
router.get('/', function(req, res, next) {
    var db=new sqlite3.Database(path.join(__dirname, "../db/LH.s3db"));
    try{
        sqlStr1 = "UPDATE manager SET password = ? where m_id = ? and password = ?";
        db.all(sqlStr1, [req.query.again_password,req.session.username,req.query.old_password],function(err){
            if(err!=null){
                res.send('0');
            }else{
                res.send('1');
            }
        } );
    }catch(ex){
        console.log(ex);
    }
});

module.exports = router;
